package cn.lzy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;


@EnableScheduling              //9.2  开启基于注解的异步任务支持
@EnableAsync                   //9.1  开启基于注解的异步任务支持

@EnableCaching                 // 开启基于Spring Boot注解的缓存管理支持
@SpringBootApplication         // 用注解标识的类作为SpringBoot(入口类)启动类
//@ImportResource("classpath:xmlproperties.xml") //加载自定义xml配置文件位置，指定配置文件的目录和名称
@ServletComponentScan          // 开启基于注解方式的 Servlet 组件扫描支持



public class ChapterApplication  {

/*    extends SpringBootServletInitializer
    // 3、程序主类继承 SpringBootServletInitializer. 并重写configure() 方法
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder){
        return builder.sources(ChapterApplication.class);
    }*/

    public static void main (String[] args) {
        SpringApplication.run(ChapterApplication.class,args);
        }
    }


